import request from '@/utils/request'

export function getDcms(ds_id) {
    return request({
        url: '/ds/analysis/getdcm',
        method: 'get',
        params: {
            ds_id
        }
    })
}

export function login(data) {
    return request({
        url: '/ds/user/sign_in',
        method: 'post',
        data: data
    })
}

export function getFindggo(id) {
    return request({
        url: '/ds/test/findggo/' + id,
        method: 'get',
    })
}
// 微信授权
export function wxLogin(code) {
    return request({
        url: '/ds/wechat/wxLogin',
        params: {
            code
        }
    })
}

// 注册
export function wxReister(data) {
    return request({
        url: '/ds/wechat/apps_register',
        method: 'post',
        data
    })
}

// 获取验证码①获取二维码:ds.pushiyixue.com/ds/wechat/apps_code?phone='手机号'&time='设置验证码有效时间'
export function wxGetphone(phone, time, idRoute) {
    return request({
        url: '/ds/wechat/apps_code',
        params: {
            phone,
            time,
            idRoute
        }
    })
}

// 用户名检测③用户名检测:ds.pushiyixue.com/ds/wechat/apps_checkname?name='用户名'
export function wxCheckname(name) {
    return request({
        url: '/ds/wechat/apps_checkname',
        params: {
            name
        }
    })
}

// 用户登陆⑤用户登录:ds.pushiyixue.com/ds/wechat/apps_login?name='用户名'&password='密码'
export function appsLogin(data) {
    return request({
        url: '/ds/wechat/apps_login',
        method: 'post',
        data
    })
}

// 重置密码⑨重置密码:ds.pushiyixue.com/ds/wechat/apps_update_psw
export function appsChangePassword(password, phone, code) {
    return request({
        url: '/ds/wechat/apps_update_psw',
        params: {
            password,
            phone,
            code
        }
    })
}

// 修改验证⑩直接获取二维码:ds.pushiyixue.com/ds/wechat/apps_verify_code?phone='手机号'&time='设置验证码有效时间'
export function wxvcode(phone, time) {
    return request({
        url: '/ds/wechat/apps_verify_code',
        params: {
            phone,
            time
        }
    })
}

// 修改个人信息:ds.pushiyixue.com/ds/wechat/apps_update_user?name='用户名'&image='图片地址'&nickname='昵称'&sex=默认Int值0&age=默认Int值0
export function appUpdateUser(name, image, nickname, sex, age) {
    return request({
        url: '/ds/wechat/apps_update_user',
        params: {
            name,
            image,
            nickname,
            sex,
            age
        }
    })
}

// 游客登陆
export function visLogin() {
    return request({
        url: '/ds/wechat/apps_visitor_login',
    })
}